var local="http://47.104.10.151";
var order_code1;
var order_code2;
var order_code3;
var order_code4;
var order_code5;
var order_code6;
var totalpage1;
var totalpage2;
var totalpage3;
//订单id
var order_id1;
var order_id2;
var order_id3;
var order_id4;
var order_id5;
var order_id6;
var page1=0;
var page2=0;
var page3=0;

function creatxmlHTTP() {
    if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlHttp=new XMLHttpRequest();
    }else {
        // IE6, IE5 浏览器执行代码
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlHttp;
}
//显示已付款待确认的订单
function seachOrder() {
    function creatxmlHTTP12111() {
        if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlHttp=new XMLHttpRequest();
        }else {
            // IE6, IE5 浏览器执行代码
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlHttp;
    }
    var xmlHttp = creatxmlHTTP12111();
    var url=local+":8080/stockorder/getStockWait";
    //拼接字符
    var txt = "page=" + page1;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);


    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");


            var tax1;
            var input1 = document.getElementsByName("Bid1");
            if (json.data.content[0].tax_status == 0) {
                input1[4].value = "无税率";
                tax1 = 0;
            } else if (json.data.content[0].tax_status == 1) {
                input1[4].value = "17%";
                tax1 = 0.17;
            }
            order_id1=json.data.content[0].keyId;
            input1[0].value = json.data.content[0].product_qty;
            input1[1].value = json.data.content[0].product_name;
            input1[2].value = json.data.content[0].product_model;
            input1[3].value = json.data.content[0].size;
            input1[5].value = json.data.content[0].sale_price;
            input1[7].value = json.data.content[0].order_code;
            order_code1=json.data.content[0].order_code;
            var sale11=json.data.content[0].sale_price;
            var num11=json.data.content[0].product_qty;
            var total1=num11*sale11*(1+tax1);
            input1[6].value = total1;

            totalpage1=json.data.totalPages;

            var input2 = document.getElementsByName("Bid2");
            var tax2;
            if (json.data.content[1].tax_status == 0) {
                input2[4].value = "无税率";
                tax2=0;
            } else if(json.data.content[1].tax_status == 1){
                input2[4].value = "17%";
                tax2=0.17;
            }
            order_id2=json.data.content[1].keyId;
            input2[0].value = json.data.content[1].product_qty;
            input2[1].value = json.data.content[1].product_name;
            input2[2].value = json.data.content[1].product_model;
            input2[3].value = json.data.content[1].size;
            input2[5].value = json.data.content[1].sale_price;
            input2[7].value = json.data.content[1].order_code;
            order_code2=json.data.content[1].order_code;
            var sale12=json.data.content[1].sale_price;
            var num12=json.data.content[1].product_qty;
            var total2=num12*sale12*(1+tax2);
            input2[6].value = total2;


            var input3 = document.getElementsByName("Bid3");
            var tax3;
            if (json.data.content[2].tax_status == 0) {
                input3[4].value = "无税率";
                tax3=0;
            } else if(json.data.content[2].tax_status == 1){
                input3[4].value = "17%";
                tax3=0.17;
            }
            order_id3=json.data.content[2].keyId;
            input3[0].value = json.data.content[2].product_qty;
            input3[1].value = json.data.content[2].product_name;
            input3[2].value = json.data.content[2].product_model;
            input3[3].value = json.data.content[2].size;
            input3[5].value = json.data.content[2].sale_price;
            input3[7].value = json.data.content[2].order_code;
            order_code3=json.data.content[2].order_code;
            var sale13=json.data.content[2].sale_price;
            var num13=json.data.content[2].product_qty;
            var total3=num13*sale13*(1+tax3);
            input3[6].value = total3;


            var input4 = document.getElementsByName("Bid4");
            var tax4;
            if (json.data.content[3].tax_status == 0) {
                input4[4].value = "无税率";
                tax4=0;
            } else if(json.data.content[3].tax_status == 1){
                input4[4].value = "17%";
                tax4=0.17;
            }
            order_id4=json.data.content[3].keyId;
            input4[0].value = json.data.content[3].product_qty;
            input4[1].value = json.data.content[3].product_name;
            input4[2].value = json.data.content[3].product_model;
            input4[3].value = json.data.content[3].size;
            input4[5].value = json.data.content[3].sale_price;
            input4[7].value = json.data.content[3].order_code;
            order_code4=json.data.content[3].order_code;
            var sale14=json.data.content[3].sale_price;
            var num14=json.data.content[3].product_qty;
            var total4=num14*sale14*(1+tax4);
            input4[6].value = total4;


            var input5 = document.getElementsByName("Bid5");
            var tax5;
            if (json.data.content[4].tax_status == 0) {
                input5[4].value = "无税率";
                tax5=0;
            } else if(json.data.content[4].tax_status == 1){
                input5[4].value = "17%";
                tax5=0.17;
            }
            order_id5=json.data.content[4].keyId;
            input5[0].value = json.data.content[4].product_qty;
            input5[1].value = json.data.content[4].product_name;
            input5[2].value = json.data.content[4].product_model;
            input5[3].value = json.data.content[4].size;
            input5[5].value = json.data.content[4].sale_price;
            input5[7].value = json.data.content[4].order_code;
            order_code5=json.data.content[4].order_code;
            var sale15=json.data.content[4].sale_price;
            var num5=json.data.content[4].product_qty;
            var total5=num5*sale15*(1+tax5);
            input5[6].value = total5;


            var input6 = document.getElementsByName("Bid6");
            var tax6;
            if (json.data.content[5].tax_status == 0) {
                input6[4].value = "无税率";
                tax6=0;
            } else if(json.data.content[5].tax_status == 1){
                input6[4].value = "17%";
                tax6=0.17;
            }
            order_id6=json.data.content[5].keyId;
            input6[0].value = json.data.content[5].product_qty;
            input6[1].value = json.data.content[5].product_name;
            input6[2].value = json.data.content[5].product_model;
            input6[3].value = json.data.content[5].size;
            input6[5].value = json.data.content[5].sale_price;
            input6[7].value = json.data.content[5].order_code;
            order_code6=json.data.content[5].order_code;
            var sale16=json.data.content[5].sale_price;
            var num16=json.data.content[5].product_qty;
            var total6=num16*sale16*(1+tax6);
            input6[6].value = total6;
//计算总金额
            var sum=total1+total2+total3+total4+total5+total6;
            document.getElementById('sum1').value=sum;

        }

    };

}


function stockload() {
     seachOrder();
     seachOrderBySelled();
     FinishStock();
}

var comfirm_id1;
var comfirm_id2;
var comfirm_id3;
var comfirm_id4;
var comfirm_id5;
var comfirm_id6;


//查询已收货未结款的订单

function seachOrderBySelled() {

    function creatxmlHTTP111() {
        if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlHttp=new XMLHttpRequest();
        }else {
            // IE6, IE5 浏览器执行代码
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlHttp;
    }


    var xmlHttp1 = creatxmlHTTP111();
    txt = "page=" + page2;//用于存储拼接字符串；
    var url=local+":8080/stockorder/getselledStock";
    //拼接字符
    xmlHttp1.open("POST", url, true);
    xmlHttp1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp1.send(txt);

    xmlHttp1.onreadystatechange = function () {
        if (xmlHttp1.readyState == 4 && xmlHttp1.status == 200) {
            var result = xmlHttp1.responseText;
            var json = eval("(" + result + ")");
            var sum;

            var tax1;
            var input1 = document.getElementsByName("Bid11");
            if (json.data.content[0].tax_status == 0) {
                input1[4].value = "无税率";
                tax1 = 0;
            } else if (json.data.content[0].tax_status == 1) {
                input1[4].value = "17%";
                tax1 = 0.17;
            }
            comfirm_id1=json.data.content[0].keyId;
            input1[0].value = json.data.content[0].product_qty;
            input1[1].value = json.data.content[0].product_name;
            input1[2].value = json.data.content[0].product_model;
            input1[3].value = json.data.content[0].size;
            input1[5].value = json.data.content[0].sale_price;
            input1[7].value = json.data.content[0].order_code;
            order_code1=json.data.content[0].order_code;
            var sale11=json.data.content[0].sale_price;
            var num11=json.data.content[0].product_qty;
            var total1=num11*sale11*(1+tax1);
            input1[6].value = total1;
            totalpage2=json.data.totalPages;

            var input2 = document.getElementsByName("Bid12");
            var tax2;
            if (json.data.content[1].tax_status == 0) {
                input2[4].value = "无税率";
                tax2=0;
            } else if(json.data.content[1].tax_status == 1){
                input2[4].value = "17%";
                tax2=0.17;
            }
            comfirm_id2=json.data.content[1].keyId;
            input2[0].value = json.data.content[1].product_qty;
            input2[1].value = json.data.content[1].product_name;
            input2[2].value = json.data.content[1].product_model;
            input2[3].value = json.data.content[1].size;
            input2[5].value = json.data.content[1].sale_price;
            input2[7].value = json.data.content[1].order_code;
            order_code2=json.data.content[1].order_code;
            var sale12=json.data.content[1].sale_price;
            var num12=json.data.content[1].product_qty;
            var total2=num12*sale12*(1+tax2);
            input2[6].value = total2;


            var input3 = document.getElementsByName("Bid13");
            var tax3;
            if (json.data.content[2].tax_status == 0) {
                input3[4].value = "无税率";
                tax3=0;
            } else if(json.data.content[2].tax_status == 1){
                input3[4].value = "17%";
                tax3=0.17;
            }
            comfirm_id3=json.data.content[2].keyId;
            input3[0].value = json.data.content[2].product_qty;
            input3[1].value = json.data.content[2].product_name;
            input3[2].value = json.data.content[2].product_model;
            input3[3].value = json.data.content[2].size;
            input3[5].value = json.data.content[2].sale_price;
            input3[7].value = json.data.content[2].order_code;
            order_code3=json.data.content[2].order_code;
            var sale13=json.data.content[2].sale_price;
            var num13=json.data.content[2].product_qty;
            var total3=num13*sale13*(1+tax3);
            input3[6].value = total3;


            var input4 = document.getElementsByName("Bid14");
            var tax4;
            if (json.data.content[3].tax_status == 0) {
                input4[4].value = "无税率";
                tax4=0;
            } else if(json.data.content[3].tax_status == 1){
                input4[4].value = "17%";
                tax4=0.17;
            }
            comfirm_id4=json.data.content[3].keyId;
            input4[0].value = json.data.content[3].product_qty;
            input4[1].value = json.data.content[3].product_name;
            input4[2].value = json.data.content[3].product_model;
            input4[3].value = json.data.content[3].size;
            input4[5].value = json.data.content[3].sale_price;
            input4[7].value = json.data.content[3].order_code;
            order_code4=json.data.content[3].order_code;
            var sale14=json.data.content[3].sale_price;
            var num14=json.data.content[3].product_qty;
            var total4=num14*sale14*(1+tax4);
            input4[6].value = total4;


            var input5 = document.getElementsByName("Bid15");
            var tax5;
            if (json.data.content[4].tax_status == 0) {
                input5[4].value = "无税率";
                tax5=0;
            } else if(json.data.content[4].tax_status == 1){
                input5[4].value = "17%";
                tax5=0.17;
            }
            comfirm_id5=json.data.content[4].keyId;
            input5[0].value = json.data.content[4].product_qty;
            input5[1].value = json.data.content[4].product_name;
            input5[2].value = json.data.content[4].product_model;
            input5[3].value = json.data.content[4].size;
            input5[5].value = json.data.content[4].sale_price;
            input5[7].value = json.data.content[4].order_code;
            order_code5=json.data.content[4].order_code;
            var sale15=json.data.content[4].sale_price;
            var num5=json.data.content[4].product_qty;
            var total5=num5*sale15*(1+tax5);
            input5[6].value = total5;


            var input6 = document.getElementsByName("Bid16");
            var tax6;
            if (json.data.content[5].tax_status == 0) {
                input6[4].value = "无税率";
                tax6=0;
            } else if(json.data.content[5].tax_status == 1){
                input6[4].value = "17%";
                tax6=0.17;
            }
            comfirm_id6=json.data.content[5].keyId;
            input6[0].value = json.data.content[5].product_qty;
            input6[1].value = json.data.content[5].product_name;
            input6[2].value = json.data.content[5].product_model;
            input6[3].value = json.data.content[5].size;
            input6[5].value = json.data.content[5].sale_price;
            input6[7].value = json.data.content[5].order_code;
            order_code6=json.data.content[5].order_code;
            var sale16=json.data.content[5].sale_price;
            var num16=json.data.content[5].product_qty;
            var total6=num16*sale16*(1+tax6);
            input6[6].value = total6;

            sum=total1+total2+total3+total4+total5+total6;
            document.getElementById('sum2').value=sum;
        }
    }
}


//结款确认


function jiekuanComfirm1() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt="";
    txt="order_id="+comfirm_id1;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm2() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+comfirm_id2;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm3() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+comfirm_id3;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm4() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+comfirm_id4;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm5() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+comfirm_id5;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm6() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+comfirm_id6;
    var url=local+":8080/stockorder/orderChangeTo5";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}

function CreatXMLHTTP() {
    //使用大部分浏览器
    var xmlHttp;
    if(window.XMLHttpRequest){
        xmlHttp=new XMLHttpRequest();
    }
    if(window.ActiveXObject){
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        if(!xmlHttp){
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    return xmlHttp;
}


function FinishStock() {
    function creatxmlHTTP1() {
        if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlHttp=new XMLHttpRequest();
        }else {
            // IE6, IE5 浏览器执行代码
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlHttp;
    }


    var xmlHttp1 = creatxmlHTTP1();
    txt = "page=" + page3;;//用于存储拼接字符串；
    var url=local+":8080/stockorder/getCompliteStock";
    //拼接字符
    xmlHttp1.open("POST", url, true);
    xmlHttp1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp1.send(txt);

    xmlHttp1.onreadystatechange = function () {
        if (xmlHttp1.readyState == 4 && xmlHttp1.status == 200) {
            var result = xmlHttp1.responseText;
            var json = eval("(" + result + ")");


            var tax1;
            var input1 = document.getElementsByName("Bid111");
            if (json.data.content[0].tax_status == 0) {
                input1[4].value = "无税率";
                tax1 = 0;
            } else if (json.data.content[0].tax_status == 1) {
                input1[4].value = "17%";
                tax1 = 0.17;
            }
            comfirm_id1=json.data.content[0].keyId;
            input1[0].value = json.data.content[0].product_qty;
            input1[1].value = json.data.content[0].product_name;
            input1[2].value = json.data.content[0].product_model;
            input1[3].value = json.data.content[0].size;
            input1[5].value = json.data.content[0].sale_price;
            input1[7].value = json.data.content[0].order_code;
            order_code1=json.data.content[0].order_code;
            var sale11=json.data.content[0].sale_price;
            var num11=json.data.content[0].product_qty;
            var total1=num11*sale11*(1+tax1);
            input1[6].value = total1;

            totalpage3=json.data.totalPages;

            var input2 = document.getElementsByName("Bid122");
            var tax2;
            if (json.data.content[1].tax_status == 0) {
                input2[4].value = "无税率";
                tax2=0;
            } else if(json.data.content[1].tax_status == 1){
                input2[4].value = "17%";
                tax2=0.17;
            }
            comfirm_id2=json.data.content[1].keyId;
            input2[0].value = json.data.content[1].product_qty;
            input2[1].value = json.data.content[1].product_name;
            input2[2].value = json.data.content[1].product_model;
            input2[3].value = json.data.content[1].size;
            input2[5].value = json.data.content[1].sale_price;
            input2[7].value = json.data.content[1].order_code;
            order_code2=json.data.content[1].order_code;
            var sale12=json.data.content[1].sale_price;
            var num12=json.data.content[1].product_qty;
            var total2=num12*sale12*(1+tax2);
            input2[6].value = total2;


            var input3 = document.getElementsByName("Bid133");
            var tax3;
            if (json.data.content[2].tax_status == 0) {
                input3[4].value = "无税率";
                tax3=0;
            } else if(json.data.content[2].tax_status == 1){
                input3[4].value = "17%";
                tax3=0.17;
            }
            comfirm_id3=json.data.content[2].keyId;
            input3[0].value = json.data.content[2].product_qty;
            input3[1].value = json.data.content[2].product_name;
            input3[2].value = json.data.content[2].product_model;
            input3[3].value = json.data.content[2].size;
            input3[5].value = json.data.content[2].sale_price;
            input3[7].value = json.data.content[2].order_code;
            order_code3=json.data.content[2].order_code;
            var sale13=json.data.content[2].sale_price;
            var num13=json.data.content[2].product_qty;
            var total3=num13*sale13*(1+tax3);
            input3[6].value = total3;


            var input4 = document.getElementsByName("Bid144");
            var tax4;
            if (json.data.content[3].tax_status == 0) {
                input4[4].value = "无税率";
                tax4=0;
            } else if(json.data.content[3].tax_status == 1){
                input4[4].value = "17%";
                tax4=0.17;
            }
            comfirm_id4=json.data.content[3].keyId;
            input4[0].value = json.data.content[3].product_qty;
            input4[1].value = json.data.content[3].product_name;
            input4[2].value = json.data.content[3].product_model;
            input4[3].value = json.data.content[3].size;
            input4[5].value = json.data.content[3].sale_price;
            input4[7].value = json.data.content[3].order_code;
            order_code4=json.data.content[3].order_code;
            var sale14=json.data.content[3].sale_price;
            var num14=json.data.content[3].product_qty;
            var total4=num14*sale14*(1+tax4);
            input4[6].value = total4;


            var input5 = document.getElementsByName("Bid155");
            var tax5;
            if (json.data.content[4].tax_status == 0) {
                input5[4].value = "无税率";
                tax5=0;
            } else if(json.data.content[4].tax_status == 1){
                input5[4].value = "17%";
                tax5=0.17;
            }
            comfirm_id5=json.data.content[4].keyId;
            input5[0].value = json.data.content[4].product_qty;
            input5[1].value = json.data.content[4].product_name;
            input5[2].value = json.data.content[4].product_model;
            input5[3].value = json.data.content[4].size;
            input5[5].value = json.data.content[4].sale_price;
            input5[7].value = json.data.content[4].order_code;
            order_code5=json.data.content[4].order_code;
            var sale15=json.data.content[4].sale_price;
            var num5=json.data.content[4].product_qty;
            var total5=num5*sale15*(1+tax5);
            input5[6].value = total5;


            var input6 = document.getElementsByName("Bid166");
            var tax6;
            if (json.data.content[5].tax_status == 0) {
                input6[4].value = "无税率";
                tax6=0;
            } else if(json.data.content[5].tax_status == 1){
                input6[4].value = "17%";
                tax6=0.17;
            }
            comfirm_id6=json.data.content[5].keyId;
            input6[0].value = json.data.content[5].product_qty;
            input6[1].value = json.data.content[5].product_name;
            input6[2].value = json.data.content[5].product_model;
            input6[3].value = json.data.content[5].size;
            input6[5].value = json.data.content[5].sale_price;
            input6[7].value = json.data.content[5].order_code;
            order_code6=json.data.content[5].order_code;
            var sale16=json.data.content[5].sale_price;
            var num16=json.data.content[5].product_qty;
            var total6=num16*sale16*(1+tax6);
            input6[6].value = total6;

             var sum=total1+total2+total3+total4+total5+total6;
            document.getElementById('sum3').value=sum;
        }
    }
}

function decOrderWait() {
    if(page1-1>=0){
        for(var i=0;i<document.getElementsByName("Bid1").length;i++){
            document.getElementsByName("Bid1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid2").length;i++){
            document.getElementsByName("Bid2")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid3").length;i++){
            document.getElementsByName("Bid3")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid4").length;i++){
            document.getElementsByName("Bid4")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid5").length;i++){
            document.getElementsByName("Bid5")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid6").length;i++){
            document.getElementsByName("Bid6")[i].value="";
        }
        page1--;
        seachOrder();
    }
    else alert("第一页");
}
function addOrderWait() {
    if(totalpage1>page1+1){
        for(var i=0;i<document.getElementsByName("Bid1").length;i++){
            document.getElementsByName("Bid1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid2").length;i++){
            document.getElementsByName("Bid2")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid3").length;i++){
            document.getElementsByName("Bid3")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid4").length;i++){
            document.getElementsByName("Bid4")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid5").length;i++){
            document.getElementsByName("Bid5")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid6").length;i++){
            document.getElementsByName("Bid6")[i].value="";
        }
        page1++;
        seachOrder();
    }
    else alert("已经是最后一页");
}


function decOrder2() {
    if(page2-1>=0){
        for(var i=0;i<document.getElementsByName("Bid11").length;i++){
            document.getElementsByName("Bid11")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid12").length;i++){
            document.getElementsByName("Bid12")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid13").length;i++){
            document.getElementsByName("Bid13")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid14").length;i++){
            document.getElementsByName("Bid14")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid15").length;i++){
            document.getElementsByName("Bid15")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid16").length;i++){
            document.getElementsByName("Bid16")[i].value="";
        }
        page2--;
        seachOrderBySelled();
    }
    else alert("第一页");
}
function addOrder2() {
    if(totalpage2>page2+1){
        for(var i=0;i<document.getElementsByName("Bid11").length;i++){
            document.getElementsByName("Bid11")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid12").length;i++){
            document.getElementsByName("Bid12")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid13").length;i++){
            document.getElementsByName("Bid13")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid14").length;i++){
            document.getElementsByName("Bid14")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid15").length;i++){
            document.getElementsByName("Bid15")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid16").length;i++){
            document.getElementsByName("Bid16")[i].value="";
        }
        page2++;
        seachOrderBySelled();
    }
    else alert("已经是最后一页");
}

function decOrder3() {
    if(page3-1>=0){
        for(var i=0;i<document.getElementsByName("Bid111").length;i++){
            document.getElementsByName("Bid111")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid122").length;i++){
            document.getElementsByName("Bid122")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid133").length;i++){
            document.getElementsByName("Bid133")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid144").length;i++){
            document.getElementsByName("Bid144")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid155").length;i++){
            document.getElementsByName("Bid155")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid166").length;i++){
            document.getElementsByName("Bid166")[i].value="";
        }
        page3--;
        FinishStock();
    }
    else alert("第一页");
}
function addOrder3() {
    if(totalpage3>page3+1){
        for(var i=0;i<document.getElementsByName("Bid111").length;i++){
            document.getElementsByName("Bid111")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid122").length;i++){
            document.getElementsByName("Bid122")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid133").length;i++){
            document.getElementsByName("Bid133")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid144").length;i++){
            document.getElementsByName("Bid144")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid155").length;i++){
            document.getElementsByName("Bid155")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Bid166").length;i++){
            document.getElementsByName("Bid166")[i].value="";
        }
        page3++;
        FinishStock();
    }
    else alert("已经是最后一页");
}